package TreeSet;


import java.util.Comparator;

public class MyComparator implements Comparator<String> {
   public int compare(String s1, String s2) {
      int temp = s1.length() - s2.length();
      if (temp == 0) {
         return s1.compareTo(s2);
      } else {
         return temp;
      }
   }
}
